import { defineStore } from "pinia";

export const useCountStore = defineStore('count', {
    // 动作
    actions:{
        changeSumAndTitle(step:number) {
            this.sum += step
            this.title = 'aaaaaaaaaaa'
            this.desc = '666666666'
        }
    },
    //状态
    state() {
        return {
            sum : 10,
            title: '这是一个测试title',
            desc:'这是内容描述'
        }
    },
    //计算
    getters: {
       bigSum:(state)=>state.sum * 10,
       changeDesc(state):string {
            return state.desc + 'bbbbbbbbbbbbbbb'
       }
    }
})